/*
 * PacketDispatcher.h
 *
 *  Created on: Apr 17, 2017
 *      Author: zhangjf
 */

#ifndef SRC_NETWORKSUBSYSTEM_PACKETDISPATCHER_H_
#define SRC_NETWORKSUBSYSTEM_PACKETDISPATCHER_H_

#include <Poco/Task.h>
#include <Poco/NotificationQueue.h>

using namespace Poco;

#include "JsonrpcProcessor.h"

using namespace util;

namespace network
{

class PacketDispatcher: public Poco::Task
{
public:
	PacketDispatcher(NotificationQueue& nq);
	virtual ~PacketDispatcher();

	void runTask();

private:
	NotificationQueue& _nq;

	void onCheckParams(const void* pSender, JsonrpcParams& params);
	void onRunJsonrpcMethod(const void* pSender, JsonrpcParams& params);
};

} /* namespace global */

#endif /* SRC_NETWORKSUBSYSTEM_PACKETDISPATCHER_H_ */
